<!DOCTYPE html>
<html>
<head>
  <title> jQuery 示例3 - 输入消息 </title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
  <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
  <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2 class="text-muted"> jQuery 示例3 - 输入消息 </h2>
  <div class="container">
  	<label id="practice" class="text-success"></label>
  </div>
  <div class="container">
    <input type="text" id="message" class="text-success" />
  </div>
  <div class="container">
    <label class="text-info">收到消息：</label>
    <label id="messageConfirm" class="text-info" ></label>
  </div>

  <div class="container">
    <label class="text-info">重复消息：</label>
    <label id="messageDuplication" class="text-info" ></label>
  </div>

  
</div>

<script>
var clickCount = 0;
$(document).ready(function(){
  // 展示文本
  $("#practice").html("Hello World! 获取输入 ");

  // 捕捉 消息输入 
  $("#message").change(function() {
    var messageText = $("#message").val();
    
    $("#messageConfirm").html(messageText);
    $("#messageDuplication").html(messageText + ";  " + messageText);

  })
  
});
</script>

</body>
</html>